﻿
@{
    ViewBag.Title = "SafetyIndexFormAdd";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css{
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <style>
        .required {
            color: red;
        }
    </style>
}

<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a>安全指标详细</a>
            </li>
            <li class="crumb-trail">安全指标</li>
        </ol>
    </div>
</header>

<div id="content" ng-cloak ng-controller="SafetyIndexController" ng-init="DataLoading=false;LoadingMsg='正在导入...';page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     id='@(Request.QueryString["formid"].IsEmpty() ? "" : Request.QueryString["formid"])';
     GetSafetyIndexTypeList();GetIndexFormDetail(id);
    ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="row" ng-repeat="x in TypeList">
        <div class="col-md-12">
            <div class="panel panel-info panel-border top mb35">
                <div class="panel-heading">
                    <span class="panel-title">填写{{x.Name}}指标信息</span>
                </div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form">
                        <table class="table table-bordered">
                            <thead>
                                <tr class="bg-light">
                                    <th style="width:5%;">一级指标</th>
                                    <th style="width:5%;">二级指标</th>
                                    <th style="width:5%;">二级指标权重</th>
                                    <th style="width:7%;">三级指标</th>
                                    <th style="width:5%;">指标序号</th>
                                    <th style="width:5%;">三级指标权重</th>
                                    <th style="width:5%;">总比重</th>
                                    <th style="width:4%;">赋值</th>
                                    <th style="width:4%;">数据情况</th>
                                    <th style="width:4%;">自动/手动</th>
                                    <th style="width:4%;">频次</th>
                                    <th style="width:8%;">来源</th>
                                    <th style="width:15%;">判断标准</th>
                                    <th style="width:8%;">a不动\b动</th>
                                    <th style="width:8%;">责任人</th>
                                    <th style="width:8%;">扣分值</th>
                                </tr>
                            </thead>

                            <tbody ng-repeat="y in x.SonList track by $index">
                            <td rowspan="{{x.AllNodesCount}}">{{x.Name}}</td>
                            <tr ng-repeat="z in y.SonList track by $index">
                                <td ng-if="$index==0" rowspan={{y.SonList.length}}>{{y.Name}}</td>
                                <td ng-if="$index==0" rowspan={{y.SonList.length}}>{{y.Percent}}</td>
                                <td>{{z.IndexName}}</td>
                                <td>{{z.IndexNo}}</td>
                                <td>{{z.Percent*100}}%</td>
                                <td>{{(y.Percent*100)*(z.Percent*100)/10000}}</td>
                                <td><input type="text" class="form-control" style="width:60px;" value="{{(y.Percent*100)*(z.Percent*100)/100}}" /></td>
                                <td>{{z.DataStatus}}</td>
                                <td>{{z.IsAutomatic}}</td>
                                <td>{{z.Interval}}</td>
                                <td>{{z.Source}}</td>
                                <td>{{z.Standard}}</td>
                                <td>{{z.aOrb}}</td>
                                <td>{{z.Responsible}}</td>
                                <td><input type="text" name="datavalue" id="{{z.Id}}" class="form-control" style="width:60px;" readonly/></td>
                            </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
                <div class="panel-footer">
                    <div class="col-lg-2"></div>
                    <button type="button" class="btn btn-info" ng-disabled="DataLoading" ng-click="SubmitIndexForm();">保存</button>
                    <div class="col-lg-2"></div>
                    <a href="LawDocumentPageList?page={{page}}" class="btn btn-warning">返回</a>
                </div>
            </div>
        </div>
    </div>
</div>

@section Js{
    <script src="~/Bussiness/js/libs/upload.js"></script>
    <script src="~/Bussiness/js/pg/SafetyIndex.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Bussiness/js/libs/moment.min.js"></script>
    <script src="~/Bussiness/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Bussiness/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Bussiness/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Bussiness/js/libs/fileinput.js"></script>
    <script src="~/Bussiness/js/libs/zh.js"></script>
    <script>
        $('#docfiles').fileinput({
            language: 'zh'
        });
        $(".selectpicker").selectpicker({
            noneSelectedText: "请选择发布机构"
        });
    </script>
}

